<?php
class Userrule_Model_Updateoradd implements Userrule_Model_Mainable{
    
    private $excepted_result = 1;
    private $current_result;
    private $update_data;
    private $insert_data;
    
    public function main(array $variable = null) {
        $this->update_data = new Userrule_Data_Updatedata;
        $this->current_result = $this->update_data->main($variable);
        if($this->curent_result == $this->excepted_result){
            return 1;
        }
        else {
            $this->insert_data = new Userrule_Data_Insertdata;
            return $this->insert_data->main($variable);
        }
    }

}
